<%@ page import="com.*" %>
<%@ page import="com.user.exception.InvalidUserException" %>

<html>
    <head>
        <style type="text/css">
            #map {
                width: 800px;
                height: 775px;
                border: 1px solid black;
            }
            .style3 {
                text-align: left;
            }
            .style4 {
		color: #5200A4;
	    }
        </style>
    </head>

    <body class="style4">

<%
            String login = request.getParameter("login");
            String password = request.getParameter("password");

            UserService userservice = (UserService) ServiceFinder.getContext(request).getBean("userservice");
            boolean isValid = false;
            try {
                UserBean authorizedUser = userservice.getUser(login, password);
                if (authorizedUser != null) {
                    out.println("Welcome  " + authorizedUser.getFname());
                    isValid = true;

                }

            } catch (InvalidUserException e) {
                out.println(e.getMessage());
            } catch (Exception e) {
                out.println(e.getMessage());
            }

            if (isValid) {
%>
<jsp:include page="GIShome.jsp"></jsp:include>
<%
            }
%>
    </body>
</html>
